﻿using BigEgg.Framework.Foundation;
using FMStudio.Domain.Properties;
using FMStudio.Domain.Test.MockClasses;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace FMStudio.Domain.Test
{
    [TestClass]
    public class AuditBillTest
    {
        [TestMethod]
        public void AuditBillTypeValidationTest()
        {
            MockAuditBill auditBill = new MockAuditBill();

            Assert.IsNull(auditBill.AuditType);
            Assert.AreEqual(Resources.AuditTypeMandatory, auditBill.Validate("AuditType"));

            MockAuditType auditType = new MockAuditType();
            auditBill.AuditType = auditType;
            Assert.AreEqual("", auditBill.Validate("AuditType"));
        }

        [TestMethod]
        public void AuditBillPriceValidationTest()
        {
            MockAuditBill auditBill = new MockAuditBill();

            Assert.AreEqual(default(double), auditBill.Price);

            auditBill.Price = 0.1;
            Assert.AreEqual("", auditBill.Validate("Price"));
            auditBill.Price = 0.0;
            Assert.AreEqual(Resources.AuditBillPriceGreater, auditBill.Validate("Price"));
            auditBill.Price = -0.1;
            Assert.AreEqual(Resources.AuditBillPriceGreater, auditBill.Validate("Price"));
        }
    }
}